{% extends "base.html" %}
{% block title %}Viewing {{pic.title}}{% endblock %}
{% block content %}
<div class='pictitle'>
  {{pic.title}}
</div>
<div class='picsubmitter'>
  {{pic.submitter}}
</div>
<div class='picview'>
  <img src='/image/{{image_key}}'>
</div>
<div class='piccaption'>
  {{pic.caption}}
</div>
<div class='pictags'>
  Tags:
  {% for tag in pic.tags %}
  <a href='/search?q={{tag}}'>{{tag}}</a>{% if not forloop.last %},{% endif %}
  {% endfor %}
</div>

<div class='booksfile'>
  Files:
  {% for book in pic.books %}
  <li><a href='/download/{{book.blobkey.key}}'> {{book.blobkey.filename}} </a>
  <br>
  {% endfor %}
</div>


<div class='uploadbook'>
  <br>
  <form action='{{bookupload_url}}' method="POST" 
  	enctype="multipart/form-data">
  Upload File: 
  <input type="file" name="bookfile"><br>
  <input type="text" name="pic_key" value='{{pic_key}}'>
  <input type="submit" name="submit" value="Upload"> 
  </form>
</div>





<a href='/album/{{pic.album.key}}'>Back to album</a>
{% endblock %}
